package com.smcaiot.jfttask.south.adapter;

import com.smcaiot.jftorg.north.local.UserAppService;
import com.smcaiot.jftorg.north.message.UserReviewResponse;
import com.smcaiot.jfttask.domain.UserReview;
import com.smcaiot.jfttask.south.convert.UserReviewResponseConvert;
import com.smcaiot.jfttask.south.port.UserClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: cz
 * @Date: 2023/9/27
 * @Description:
 */
@Component
public class UserClientAdapter implements UserClient {

    @Autowired
    private UserAppService userAppService;

    @Override
    public UserReview getUser(String userId) {
        UserReviewResponse response = userAppService.getUser(userId);
        return UserReviewResponseConvert.INSTANCE.to(response);
    }

    @Override
    public boolean isFujing(String role) {
        return userAppService.isFujing(role);
    }

    @Override
    public boolean isFJLeader(String role) {
        return userAppService.isFJLeader(role);
    }

    @Override
    public boolean isKSLeader(String role) {
        return userAppService.isKSLeader(role);
    }
}
